export default {
  state: {
    version: '0.0.1'
  },
  mutations: {
    REFRESHVERSION(state: any, version: string) {
      !!version && (state.version = version);
      console.log(state.version);
    }
  },
  actions: {
    refreshVersion: ({ commit }: any, version: string) =>
      new Promise((resolve, reject) => {
        if (!!version) {
          commit("REFRESHVERSION", version)
          resolve(true)
        } else {
          commit("REFRESHVERSION", version)
          reject(false)
        }
      })
  }
}